Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Fix double shufti's false positive #316

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ypicchi-arm
Copy link

When one have a search pattern with two characters (eg "ab"), and the first character is the last character of a vector, then it triggers a match, regardless of whether or not the second character appear in the next vector. (so only 'a' is require to match)
This patch fix it.

The bug have been reproduced on neon, sve and x86.
To experience the bug, just reverse the order of the pattern in the benchmark ("ba" instead of "ab" and you'll notice it returns almost instantaneously)

It does produce a 16% slowdown though. It might be faster to process the string 15 chars at a time instead of 16 and thus saving a load each time, but it requires more change than I can do just now.

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
If we look for a pattern like "ab" and the letter 'a' fall at the end of the vector,
then it was reporting a positive match, regardless of the second letter.
This patch fix this false positive, but slows shufti down by 16%.

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant